<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>EncryptUtil</title>
</head>
<body>
<script src="../../../lib/baitu.min.js"></script>
<script>
    const {EncryptUtil} = Baitu;
    console.log(EncryptUtil)
    const encode = EncryptUtil.Base64.encode("13sdfvsd");
    console.log(encode)
    console.log(EncryptUtil.Base64.decode(encode))
    console.log(EncryptUtil.MD5("天那独立访客数大肠杆菌第三方"))

    console.log("-----------")

    const publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9f4XutO8jch6RSlz2SOPtu6boUbdhQXyBwVCyZNEESh54m9JG1K0fKcJ0/AsQ2ifGfCP0cd4xSrmEfIr0XD/BwRp6BfBFQjLlnQFsrBQjJgZdUulq9MfIEz4KbKuHhBtmLYjgMlB4hWGut+yYwR1crFmOOIA37HGP+ZbiP95uF9g1ZOFiCAvwT1WCbsQ7QQN1IjReuMYCMen0d/J+IcpjgyopGABZcDByy2SoG5bYDRKibPInlyoNz4edjf+WMXH5ny2VjZqSTv6xR9PVahPo10cU4t94a1d3JB3LJPO1d+OVbADeVoZrfXWeV2OaaAchLqwLqq5b9gbWfLkTHdzKQIDAQAB"
    const privateKey = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQD1/he607yNyHpFKXPZI4+27puhRt2FBfIHBULJk0QRKHnib0kbUrR8pwnT8CxDaJ8Z8I/Rx3jFKuYR8ivRcP8HBGnoF8EVCMuWdAWysFCMmBl1S6Wr0x8gTPgpsq4eEG2YtiOAyUHiFYa637JjBHVysWY44gDfscY/5luI/3m4X2DVk4WIIC/BPVYJuxDtBA3UiNF64xgIx6fR38n4hymODKikYAFlwMHLLZKgbltgNEqJs8ieXKg3Ph52N/5YxcfmfLZWNmpJO/rFH09VqE+jXRxTi33hrV3ckHcsk87V345VsAN5Whmt9dZ5XY5poByEurAuqrlv2BtZ8uRMd3MpAgMBAAECggEBAL3qVx25PNhlz+g3kaYxq1G7M9I2q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WSSP8PARF9nI/yBoHDXCVHP6pkvs6kIE4reB8XZm0g/H87+LusbvzZfk1DwqhcL70jqiWM7J/wMcsVsDTQFjuooOF3UASAkYAUqBwdNE4RiBPj8z6B9ns9l7/+wUb9g=="

    let rsa = EncryptUtil.RSA.build(publicKey, privateKey);
    var s1 = rsa.encodePublic("123");
    console.log(s1)
    console.log(rsa.decodePrivate(s1))

    console.log("------------")
    console.log(EncryptUtil.AES.build)
    let aes = EncryptUtil.AES.build("1234567890123456");
    // aes.setPadding(aes.pads.Pkcs7);
    // aes.setMode(aes.mods.ECB);
    const aesEncode = aes.encode("11111");
    console.log(aesEncode)
    console.log(aes.decode(aesEncode))
</script>
</body>
</html>
